package com.fengyi.homefurnish.service.impl;

import com.fengyi.homefurnish.mapper.CouponsInfoMapper;
import com.fengyi.homefurnish.pojo.CouponsInfo;
import com.fengyi.homefurnish.service.CouponsInfoService;
import com.fengyi.homefurnish.utils.Pager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class CouponsInfoServiceImpl implements CouponsInfoService {

    @Autowired
    private CouponsInfoMapper couponsInfoMapper;

    @Override
    public Pager<CouponsInfo> getCouponsPager(Integer offset, Integer limit, CouponsInfo couponsInfo) {
        Pager<CouponsInfo> pager = new Pager<>();
        pager.setRows(couponsInfoMapper.getCouponsByPager(offset,limit,couponsInfo));
        pager.setTotal(couponsInfoMapper.getCouponsTotal(couponsInfo));
        return pager;
    }
}
